#pragma once

#include <iostream>
#include <tchar.h>
#include "fmodincludes\fmod.h"
#include "fmodincludes\fmod.hpp"
#include "fmodincludes\fmod_errors.h"

#pragma comment ( lib, "fmodex_vc.lib" )

//used to identify the sound for playSound( ) below
#define CLICK		0
#define EXPLOSION	1

class AudioPlay
{
public:
	AudioPlay( ) ;
	~AudioPlay( ) ;

	void loadSound( char * filename ) { system->createSound(filename, FMOD_DEFAULT, 0, &m_sound); }
	void updateAudio( ) ; //updates the system
	void playSound( ) ; //plays a particular sound
	void playBGM( ) ; //plays the BGM

private:
	FMOD_RESULT result;

	//system pointer
	FMOD::System *system;

	//sound pointers for each sound
	FMOD::Sound *m_sound;

	//channel used for music
	FMOD::Channel *channel_sound;

	unsigned int version;
	int numdrivers;
	int m_soundCounter ;
	FMOD_SPEAKERMODE speakermode;
	FMOD_CAPS caps;
	char name[256];
	
} ;